home *** CD-ROM | disk | FTP | other *** search
/ Nautilus 1992 July / Nautilus-3-8 / Nautilus-3-8.bin / Tools & Utilities / Techy Stuff / Source ƒ / byacc-MPW Folder / yacc.1 < prev    next >
Encoding:
Text File  |  1991-10-14  |  4.6 KB  |  175 lines

  1. .\" Copyright (c) 1989, 1990 The Regents of the University of California.
  2. .\" All rights reserved.
  3. .\"
  4. .\" This code is derived from software contributed to Berkeley by
  5. .\" Robert Paul Corbett.
  6. .\"
  7. .\" Redistribution and use in source and binary forms, with or without
  8. .\" modification, are permitted provided that the following conditions
  9. .\" are met:
  10. .\" 1. Redistributions of source code must retain the above copyright
  11. .\"    notice, this list of conditions and the following disclaimer.
  12. .\" 2. Redistributions in binary form must reproduce the above copyright
  13. .\"    notice, this list of conditions and the following disclaimer in the
  14. .\"    documentation and/or other materials provided with the distribution.
  15. .\" 3. All advertising materials mentioning features or use of this software
  16. .\"    must display the following acknowledgement:
  17. .\"    This product includes software developed by the University of
  18. .\"    California, Berkeley and its contributors.
  19. .\" 4. Neither the name of the University nor the names of its contributors
  20. .\"    may be used to endorse or promote products derived from this software
  21. .\"    without specific prior written permission.
  22. .\"
  23. .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  24. .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  25. .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  26. .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  27. .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  28. .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  29. .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  30. .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  31. .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  32. .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  33. .\" SUCH DAMAGE.
  34. .\"
  35. .\"     @(#)yacc.1    5.7 (Berkeley) 7/30/91
  36. .\"
  37. .Dd July 30, 1991
  38. .Dt YACC 1
  39. .Os
  40. .Sh NAME
  41. .Nm yacc
  42. .Nd an
  43. .Tn LALR(1)
  44. parser generator
  45. .Sh SYNOPSIS
  46. .Nm yacc
  47. .Op Fl dlrtv
  48. .Op Fl b Ar prefix
  49. .Ar filename
  50. .Sh DESCRIPTION
  51. .Nm Yacc
  52. reads the grammar specification in the file
  53. .Ar filename
  54. and generates an
  55. .Tn LR(1)
  56. parser for it.
  57. The parsers consist of a set of
  58. .Tn LALR(1)
  59. parsing tables and a driver routine
  60. written in the C programming language.
  61. .Nm Yacc
  62. normally writes the parse tables and the driver routine to the file
  63. .Pa y.tab.c .
  64. .Pp
  65. The following options are available:
  66. .Bl -tag -width Ar
  67. .It Fl b Ar prefix
  68. The
  69. .Fl b
  70. option changes the prefix prepended to the output file names to
  71. the string denoted by
  72. .Ar prefix .
  73. The default prefix is the character
  74. .Ar y .
  75. .It Fl d
  76. The
  77. .Fl d
  78. option causes the header file
  79. .Pa y.tab.h
  80. to be written.
  81. .It Fl l
  82. If the
  83. .Fl l
  84. option is not specified,
  85. .Nm yacc
  86. will insert \#line directives in the generated code.
  87. The \#line directives let the C compiler relate errors in the
  88. generated code to the user's original code.
  89. If the
  90. .Fl l
  91. option is specified,
  92. .Nm yacc
  93. will not insert the \#line directives.
  94. \&\#line directives specified by the user will be retained.
  95. .It Fl r
  96. The
  97. .Fl r
  98. option causes
  99. .Nm yacc
  100. to produce separate files for code and tables.
  101. The code file is named
  102. .Pa y.code.c ,
  103. and the tables file is named
  104. .Pa y.tab.c .
  105. .It Fl t
  106. The
  107. .Fl t
  108. option changes the preprocessor directives generated by
  109. .Nm yacc
  110. so that debugging statements will be incorporated in the compiled code.
  111. .It Fl v
  112. The
  113. .Fl v
  114. option causes a human-readable description of the generated parser to
  115. be written to the file
  116. .Pa y.output .
  117. .Pp
  118. .Sh ENVIRONMENT
  119. The following environment variable is referenced by
  120. .Nm yacc :
  121. .Bl -tag -width TMPDIR
  122. .It Ev TMPDIR
  123. If the environment variable
  124. .Ev TMPDIR
  125. is set, the string denoted by
  126. .Ev TMPDIR
  127. will be used as the name of the directory where the temporary
  128. files are created.
  129. .El
  130. .Sh TABLES
  131. The names of the tables generated by this version of
  132. .Nm yacc
  133. are
  134. .Dq yylhs ,
  135. .Dq yylen ,
  136. .Dq yydefred ,
  137. .Dq yydgoto ,
  138. .Dq yysindex ,
  139. .Dq yyrindex ,
  140. .Dq yygindex ,
  141. .Dq yytable ,
  142. and
  143. .Dq yycheck .
  144. Two additional tables,
  145. .Dq yyname
  146. and
  147. .Dq yyrule ,
  148. are created if
  149. .Dv YYDEBUG
  150. is defined and non-zero.
  151. .Sh FILES
  152. .Bl -tag -width /tmp/yacc.uXXXXXXXX -compact
  153. .It Pa y.code.c
  154. .It Pa y.tab.c
  155. .It Pa y.tab.h
  156. .It Pa y.output
  157. .It Pa /tmp/yacc.aXXXXXX
  158. .It Pa /tmp/yacc.tXXXXXX
  159. .It Pa /tmp/yacc.uXXXXXX
  160. .El
  161. .Sh DIAGNOSTICS
  162. If there are rules that are never reduced, the number of such rules is
  163. written to the standard error.
  164. If there are any
  165. .Tn LALR(1)
  166. conflicts, the number of conflicts is also written
  167. to the standard error.
  168. .Sh SEE ALSO
  169. .Xr yyfix 1
  170. .Sh STANDARDS
  171. The
  172. .Nm yacc
  173. utility conforms to
  174. .St -p1003.2 .
  175.